package leetcode234

type ListNode struct {
	Val  int
	Next *ListNode
}

func isPalindrome(head *ListNode) bool {
	var temp = make([]int, 0)

	for head != nil {
		temp = append(temp, head.Val)
		head = head.Next
	}
	n := len(temp)
	for i, v := range temp[:n/2] {
		if v != temp[n-i-1] {
			return false
		}
	}
	return true
}
